package com.youdoneed.news.news.dao;

import java.util.List;

import com.youdoneed.news.news.vo.CmfNavVo;
import org.apache.ibatis.annotations.Mapper;

import com.youdoneed.news.news.entity.CmfNav;
import com.youdoneed.news.news.entity.CmfNavRelation;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

@Mapper
//@CacheConfig(cacheNames = "cmfnav")
public interface CmfNavMapper {

    //@CacheEvict(key="'cmfNav'+#id")
	int deleteByPrimaryKey(Integer id);


    int insert(CmfNav record);


    int insertSelective(CmfNav record);

    //@Cacheable(key="'cmfNav'+#id")
    CmfNav selectByPrimaryKey(Integer id);

    //@CacheEvict(key="'cmfNav'+#record.id")
    int updateByPrimaryKeySelective(CmfNav record);

    //@CacheEvict(key="'cmfNav'+#record.id")
    int updateByPrimaryKey(CmfNav record);

    /**
     * 获取主导航列表
     * @return
     */
    //@Cacheable(keyGenerator = "wiselyKeyGenerator")
    List<CmfNavVo> getAllNewsNav(Integer cid);
    
    /**
     * 获取关注的导航列表
     * @return
     */
    //@Cacheable(keyGenerator = "wiselyKeyGenerator")
   CmfNavVo getFocusNewsNav(Integer id);

    /**
     * 查询子导航
     * @param parentId
     * @return
     */
    //@Cacheable(key="'subNewsNav'+#parentId")
    List<CmfNavVo> getSubNewsNav(Integer parentId);
    
}